function(set_warning_level)
	set(target ${ARGV0})
	set(warning_target "${target}_warnings")
	set(level ${ARGV1})
	
	add_library(${warning_target} INTERFACE)
	if (MSVC)
		# Remove any set warning up to now
		if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
			string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
		endif()
		set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
	endif()
	
	if(level MATCHES "standard")
		if (MSVC)
			target_compile_options(${warning_target} INTERFACE /W2)
		else()
			target_compile_options(${warning_target} INTERFACE -Wall)
		endif()
	elseif(level MATCHES "high")	
		if (MSVC)
			target_compile_options(${warning_target} INTERFACE /W3)
		else()
			target_compile_options(${warning_target} INTERFACE -Wall -Wextra)
		endif()
	elseif(level MATCHES "ultra")
		if (MSVC)
			target_compile_options(${warning_target} INTERFACE /W4)
		else()
			target_compile_options(${warning_target} INTERFACE -Wall -Wextra -Wpedantic)
		endif()
	endif()
	
	target_link_libraries(${target} PRIVATE ${warning_target})
	
endfunction()
